package com.wxproject.demo.Service.impl;

import com.wxproject.demo.Entity.AO.PublishCommentAO;
import com.wxproject.demo.Entity.Model.CommentDO;
import com.wxproject.demo.Service.CommentService;
import com.wxproject.demo.Utils.DateUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import com.wxproject.demo.Entity.AO.CommentReplyAO;
import com.wxproject.demo.Entity.AO.ReplyArticleAO;
import com.wxproject.demo.Entity.AO.ReplyTwoCommentAO;
import com.wxproject.demo.Mapper.CommentMapper;
import com.wxproject.demo.Service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * @author HCJ
 * @date 2021/4/28 22:38
 * @description
 */
@Service
public class CommentServiceImpl implements CommentService {

    @Override
    public String CreateComment(PublishCommentAO publishCommentAO) {
        //创建实体对象并赋值参数
        CommentDO commentDO = new CommentDO();
        BeanUtils.copyProperties(publishCommentAO,commentDO);
        //赋值时间
        commentDO.setCreateTime(DateUtils.getDate());
        //点赞和踩默认为零
        commentDO.setLikeCount("0");
        commentDO.setDisLikeCount("0");
        return null;
    }

    @Override
    public String ArticleGetComment() {

        return null;
    }

    @Autowired
    private CommentMapper commentMapper;
    @Override
    public Integer replyArticle(ReplyArticleAO articleAO) {
        return commentMapper.replyArticle(articleAO);
    }

    @Override
    public Integer commentReply(CommentReplyAO comment) {
        return commentMapper.commentReply(comment);
    }

    @Override
    public Integer replyTwoComment(ReplyTwoCommentAO twoCommentAO) {
        return commentMapper.replyTwoComment(twoCommentAO);
    }
}
